function move(A, C){
    console.log(A+"-"+C);
}
function hanoi(n, A, B, C){
    if(n === 1){
        move(A,C);
        return;
    }
    hanoi(n-1,A, C, B);
    move(A,C);
    hanoi(n-1, B, A, C);
}

const n = 3;
hanoi(n ,"A", "B", "C");